Optimal. Leaf size=158 \[ -\frac {\left (a^2+b^2\right )^2 \log (\cos (c+d x))}{b^5 d}+\frac {\left (a^2+b^2\right )^2 \log (a \cos (c+d x)+b \sin (c+d x))}{b^5 d}-\frac {a \left (a^2+b^2\right ) \tan (c+d x)}{b^4 d}+\frac {\left (a^2+b^2\right ) \sec ^2(c+d x)}{2 b^3 d}-\frac {a \tan ^3(c+d x)}{3 b^2 d}-\frac {a \tan (c+d x)}{b^2 d}+\frac {\sec ^4(c+d x)}{4 b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.22, antiderivative size = 158, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3104, 3767, 8, 3102, 3475, 3133} \[ -\frac {a \left (a^2+b^2\right ) \tan (c+d x)}{b^4 d}+\frac {\left (a^2+b^2\right ) \sec ^2(c+d x)}{2 b^3 d}-\frac {\left (a^2+b^2\right )^2 \log (\cos (c+d x))}{b^5 d}+\frac {\left (a^2+b^2\right )^2 \log (a \cos (c+d x)+b \sin (c+d x))}{b^5 d}-\frac {a \tan ^3(c+d x)}{3 b^2 d}-\frac {a \tan (c+d x)}{b^2 d}+\frac {\sec ^4(c+d x)}{4 b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3102
Rule 3104
Rule 3133
Rule 3475
Rule 3767
Rubi steps
\begin {align*} \int \frac {\sec ^5(c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx &=\frac {\sec ^4(c+d x)}{4 b d}-\frac {a \int \sec ^4(c+d x) \, dx}{b^2}+\frac {\left (a^2+b^2\right ) \int \frac {\sec ^3(c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx}{b^2}\\ &=\frac {\left (a^2+b^2\right ) \sec ^2(c+d x)}{2 b^3 d}+\frac {\sec ^4(c+d x)}{4 b d}-\frac {\left (a \left (a^2+b^2\right )\right ) \int \sec ^2(c+d x) \, dx}{b^4}+\frac {\left (a^2+b^2\right )^2 \int \frac {\sec (c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx}{b^4}+\frac {a \operatorname {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{b^2 d}\\ &=\frac {\left (a^2+b^2\right ) \sec ^2(c+d x)}{2 b^3 d}+\frac {\sec ^4(c+d x)}{4 b d}-\frac {a \tan (c+d x)}{b^2 d}-\frac {a \tan ^3(c+d x)}{3 b^2 d}+\frac {\left (a^2+b^2\right )^2 \int \frac {b \cos (c+d x)-a \sin (c+d x)}{a \cos (c+d x)+b \sin (c+d x)} \, dx}{b^5}+\frac {\left (a^2+b^2\right )^2 \int \tan (c+d x) \, dx}{b^5}+\frac {\left (a \left (a^2+b^2\right )\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{b^4 d}\\ &=-\frac {\left (a^2+b^2\right )^2 \log (\cos (c+d x))}{b^5 d}+\frac {\left (a^2+b^2\right )^2 \log (a \cos (c+d x)+b \sin (c+d x))}{b^5 d}+\frac {\left (a^2+b^2\right ) \sec ^2(c+d x)}{2 b^3 d}+\frac {\sec ^4(c+d x)}{4 b d}-\frac {a \tan (c+d x)}{b^2 d}-\frac {a \left (a^2+b^2\right ) \tan (c+d x)}{b^4 d}-\frac {a \tan ^3(c+d x)}{3 b^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.17, size = 99, normalized size = 0.63 \[ \frac {6 b^2 \left (a^2+b^2\right ) \tan ^2(c+d x)-12 a b \left (a^2+2 b^2\right ) \tan (c+d x)+12 \left (a^2+b^2\right )^2 \log (a+b \tan (c+d x))-4 a b^3 \tan ^3(c+d x)+3 b^4 \sec ^4(c+d x)}{12 b^5 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.45, size = 183, normalized size = 1.16 \[ \frac {6 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{4} \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) - 6 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{4} \log \left (\cos \left (d x + c\right )^{2}\right ) + 3 \, b^{4} + 6 \, {\left (a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2} - 4 \, {\left (a b^{3} \cos \left (d x + c\right ) + {\left (3 \, a^{3} b + 5 \, a b^{3}\right )} \cos \left (d x + c\right )^{3}\right )} \sin \left (d x + c\right )}{12 \, b^{5} d \cos \left (d x + c\right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 4.89, size = 120, normalized size = 0.76 \[ \frac {\frac {3 \, b^{3} \tan \left (d x + c\right )^{4} - 4 \, a b^{2} \tan \left (d x + c\right )^{3} + 6 \, a^{2} b \tan \left (d x + c\right )^{2} + 12 \, b^{3} \tan \left (d x + c\right )^{2} - 12 \, a^{3} \tan \left (d x + c\right ) - 24 \, a b^{2} \tan \left (d x + c\right )}{b^{4}} + \frac {12 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{b^{5}}}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.23, size = 162, normalized size = 1.03 \[ \frac {\tan ^{4}\left (d x +c \right )}{4 d b}-\frac {a \left (\tan ^{3}\left (d x +c \right )\right )}{3 b^{2} d}+\frac {\left (\tan ^{2}\left (d x +c \right )\right ) a^{2}}{2 d \,b^{3}}+\frac {\tan ^{2}\left (d x +c \right )}{d b}-\frac {\tan \left (d x +c \right ) a^{3}}{d \,b^{4}}-\frac {2 a \tan \left (d x +c \right )}{b^{2} d}+\frac {\ln \left (a +b \tan \left (d x +c \right )\right ) a^{4}}{d \,b^{5}}+\frac {2 \ln \left (a +b \tan \left (d x +c \right )\right ) a^{2}}{d \,b^{3}}+\frac {\ln \left (a +b \tan \left (d x +c \right )\right )}{d b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.34, size = 462, normalized size = 2.92 \[ -\frac {\frac {2 \, {\left (\frac {3 \, {\left (a^{3} + 2 \, a b^{2}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {3 \, {\left (a^{2} b + 2 \, b^{3}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {{\left (9 \, a^{3} + 14 \, a b^{2}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {6 \, {\left (a^{2} b + b^{3}\right )} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {{\left (9 \, a^{3} + 14 \, a b^{2}\right )} \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {3 \, {\left (a^{2} b + 2 \, b^{3}\right )} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} - \frac {3 \, {\left (a^{3} + 2 \, a b^{2}\right )} \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}\right )}}{b^{4} - \frac {4 \, b^{4} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {6 \, b^{4} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {4 \, b^{4} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {b^{4} \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}}} - \frac {3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \log \left (-a - \frac {2 \, b \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}{b^{5}} + \frac {3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{b^{5}} + \frac {3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{b^{5}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.68, size = 575, normalized size = 3.64 \[ \frac {\left (6\,a^3\,b+12\,a\,b^3\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (6\,a^2\,b^2+12\,b^4\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (-18\,a^3\,b-28\,a\,b^3\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-12\,a^2\,b^2-12\,b^4\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (18\,a^3\,b+28\,a\,b^3\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (6\,a^2\,b^2+12\,b^4\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\left (-6\,a^3\,b-12\,a\,b^3\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (3\,b^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-12\,b^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+18\,b^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-12\,b^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+3\,b^5\right )}-\frac {a^4\,\mathrm {atan}\left (\frac {b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,1{}\mathrm {i}-b^2\,1{}\mathrm {i}+2{}\mathrm {i}\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{-2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,a^2+2\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+b^2}\right )\,2{}\mathrm {i}+b^4\,\mathrm {atan}\left (\frac {b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,1{}\mathrm {i}-b^2\,1{}\mathrm {i}+2{}\mathrm {i}\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{-2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,a^2+2\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+b^2}\right )\,2{}\mathrm {i}+a^2\,b^2\,\mathrm {atan}\left (\frac {b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,1{}\mathrm {i}-b^2\,1{}\mathrm {i}+2{}\mathrm {i}\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{-2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,a^2+2\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+b^2}\right )\,4{}\mathrm {i}}{b^5\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec ^{5}{\left (c + d x \right )}}{a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________